<div class="bg-light lter b-b wrapper-md ng-scope">
    <h4 class="m-n font-thin">资产管理</h4>
</div>
<div ng-controller="propertyCtrl">
    <tabset class="tab-container wrapper">
        <tab heading="商家提现" ng-click="changeType(0)">
            <div class="panel m-n">
                <div class="col-sm-9 m-b">
                    <form class="form-inline">
                        <div class="form-group block m-t-sm">
                            <div class="form-group">
                                <label class="control-label">申请人</label>
                                <input type="text" ng-model="withdrawal.proposer" class="input-sm form-control">
                            </div>
                            <div class="form-group">
                                <label class="control-label">操作编号</label>
                                <input type="text" ng-model="withdrawal.withdrawalNumber" class="input-sm form-control">
                            </div>
                            <label class="control-label">提现状态</label>
                            <select class="input-sm form-control" ng-model="withdrawal.status">
                                <option  value="">－请选择－</option>
                                <option  value="0">申请中</option>
                                <option  value="1">银行处理中</option>
                                <option  value="2">提现成功</option>
                                <option  value="3">提现失败</option>
                            </select>
                        </div>
                        <button class="btn btn-sm btn-info" ng-click="query()">查询</button>
                    </form>
                </div>

                <div class="table-responsive">
                    <table class="table table-striped b-t b-light">
                        <thead>
                        <tr>
                            <th>店铺名称</th>
                            <th>申请人</th>
                            <th>操作编号</th>
                            <th>提现金额</th>
                            <th>到账银行</th>
                            <th width="280">操作时间</th>
                            <th>状态</th>
                            <th>备注</th>
                            <th width="200">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="item in list">
                            <td>
                                {{item.shopName}}
                            </td>
                            <td>
                                姓名：{{item.proposer}}<br>
                                联系方式：{{item.mobilePhone}}
                            </td>
                            <td>{{item.withdrawalNumber}}</td>
                            <td>{{item.withdrawalMoney | number:2}} 元</td>
                            <td>
                                <span ng-if="item.bankStatus==1">银行：{{item.bank}}({{item.bankType}})<br></span>
                                <span ng-if="item.bankStatus==0">公司：{{item.companyName}}<br></span>
                                银行卡号：{{item.bankCard}}<br>
                                开户行：{{item.bankAddress}}
                            </td>
                            <td>
                                <span ng-if="item.applyTime != null">申请时间：{{item.applyTime}}</span><br>
                                <span ng-if="item.disposeTime != null">开始处理时间：{{item.disposeTime}}</span><br>
                                <span ng-if="item.completeTime != null">处理结束时间：{{item.completeTime}}</span>
                            </td>
                            <td>
                                <span class="label bg-info" ng-if='item.status == 0'>申请中</span>
                                <span class="label bg-warning" ng-if='item.status == 1'>银行处理中</span>
                                <span class="label bg-success" ng-if='item.status == 2'>提现成功</span>
                                <span class="label bg-danger" ng-if='item.status == 3'>提现失败</span>
                            </td>
                            <td>
                                {{item.remark}}
                            </td>
                            <td>
                                <button class="btn btn-sm btn-info" ng-if="item.status==0" ng-click="agree(item.id,1)">同意</button>
                                <button class="btn btn-sm btn-success" ng-if="item.status==1" ng-click="agree(item.id,2)">转账完成</button>
                                <a class="btn btn-sm btn-danger" ng-if="item.status==0 || item.status==1 " ui-sref="app.withdrawalFail({id:item.id})" target="_blank">拒绝</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <div ng-if="list.length<=0 && !app.loading" class="padder-v text-center">
                        <span class="h6">~未搜索到任何数据~</span>
                    </div>
                    <div>
                        <circle-loading ng-if="app.loading"></circle-loading>
                    </div>
                </div>
                <footer class="panel-footer">
                    <div class="row">
                        <div class="col-sm-offset-4 col-sm-4 text-center text-center-xs">
                            <small class="text-muted inline m-t-sm m-b-sm">显示第 {{startRow}} 至 {{endRow}} 项结果，共 {{totalItems}} 项</small>
                        </div>
                        <div class="col-sm-4 text-right text-center-xs">
                            <pagination boundary-links="true" total-items="totalItems" ng-model="page.currentPage"
                                        ng-change="replacePage()" max-size="{{maxPageRow}}" class="pagination-sm m-t-none m-b"
                                        previous-text="上一页" next-text="下一页"
                                        first-text="首页" last-text="尾页"></pagination>
                        </div>
                    </div>
                </footer>
            </div>
        </tab>
        <tab heading="用户提现" ng-click="changeType(1)">
            <div class="panel m-n">
                <div class="col-sm-9 m-b">
                    <form class="form-inline">
                        <div class="form-group block m-t-sm">
                            <div class="form-group">
                                <label class="control-label">申请人</label>
                                <input type="text" ng-model="withdrawal.proposer" class="input-sm form-control">
                            </div>
                            <div class="form-group">
                                <label class="control-label">操作编号</label>
                                <input type="text" ng-model="withdrawal.withdrawalNumber" class="input-sm form-control">
                            </div>
                            <label class="control-label">提现状态</label>
                            <select class="input-sm form-control" ng-model="withdrawal.status">
                                <option  value="">－请选择－</option>
                                <option  value="0">申请中</option>
                                <option  value="1">银行处理中</option>
                                <option  value="2">提现成功</option>
                                <option  value="3">提现失败</option>
                            </select>
                        </div>
                        <button class="btn btn-sm btn-info" ng-click="query()">查询</button>
                    </form>
                </div>

                <div class="table-responsive">
                    <table class="table table-striped b-t b-light">
                        <thead>
                        <tr>
                            <th>申请人</th>
                            <th>操作编号</th>
                            <th>提现金额</th>
                            <th>到账银行</th>
                            <th>操作时间</th>
                            <th>状态</th>
                            <th>备注</th>
                            <th width="200">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="item in list">
                            <td>
                                姓名：{{item.proposer}}<br>
                                联系方式：{{item.mobilePhone}}
                            </td>
                            <td>{{item.withdrawalNumber}}</td>
                            <td>{{item.withdrawalMoney}}</td>
                            <td>
                                银行：{{item.bank}}({{item.bankType}})<br>
                                银行卡号：{{item.bankCard}}<br>
                                开户行：{{item.bankAddress}}
                            </td>
                            <td>
                                <span ng-if="item.applyTime != null">申请时间：{{item.applyTime}}</span><br>
                                <span ng-if="item.disposeTime != null">开始处理时间：{{item.disposeTime}}</span><br>
                                <span ng-if="item.completeTime != null">处理结束时间：{{item.completeTime}}</span>
                            </td>
                            <td>
                                <span class="label bg-info" ng-if='item.status==0'>申请中</span>
                                <span class="label bg-warning" ng-if='item.status==1'>银行处理中</span>
                                <span class="label bg-success" ng-if='item.status==2'>提现成功</span>
                                <span class="label bg-danger" ng-if='item.status==3'>提现失败</span>
                            </td>
                            <td>
                                {{item.remark}}
                            </td>
                            <td>
                                <button class="btn btn-sm btn-info" ng-if="item.status==0" ng-click="agree(item.id,1)">同意</button>
                                <button class="btn btn-sm btn-success" ng-if="item.status==1" ng-click="agree(item.id,2)">转账完成</button>
                                <a class="btn btn-sm btn-danger" ng-if="item.status==0 || item.status==1 " ui-sref="app.withdrawalFail({id:item.id})" target="_blank">拒绝</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <div ng-if="list.length<=0 && !app.loading" class="padder-v text-center">
                        <span class="h6">~未搜索到任何数据~</span>
                    </div>
                    <div>
                        <circle-loading ng-if="app.loading"></circle-loading>
                    </div>
                </div>
                <footer class="panel-footer">
                    <div class="row">
                        <div class="col-sm-offset-4 col-sm-4 text-center text-center-xs">
                            <small class="text-muted inline m-t-sm m-b-sm">显示第 {{startRow}} 至 {{endRow}} 项结果，共 {{totalItems}} 项</small>
                        </div>
                        <div class="col-sm-4 text-right text-center-xs">
                            <pagination boundary-links="true" total-items="totalItems" ng-model="page.currentPage"
                                        ng-change="replacePage()" max-size="{{maxPageRow}}" class="pagination-sm m-t-none m-b"
                                        previous-text="上一页" next-text="下一页"
                                        first-text="首页" last-text="尾页"></pagination>
                        </div>
                    </div>
                </footer>
            </div>
        </tab>
    </tabset>
</div>